import { defineStore } from "pinia"
import { ref } from 'vue'

export const useLoginStore = defineStore(
    'loginInfo',
    () => {
        //定义loginInfo
        const loginInfo = ref(0)

        //设置loginInfo的值
        function setLoginInfo (newLoginInfo: number) {
            loginInfo.value = newLoginInfo
        }

        //移除loginInfo的值
        function removeLoginInfo () {
            loginInfo.value = 0
        }

        return {
            loginInfo, setLoginInfo, removeLoginInfo
        }
    },
    {
        persist:true
    }
)